package tesys.objects;
/**
 * @author Group5 Comp3350
 * This class defines a ElectionCandidate object
 * describe ER between Election & Candidate task
 * It's a subclass of Task
 * 
 */
public class ElectionCandidate
{
	
	private String eid;//Election id
	private String tid;//task id
	
	//constructors

	public ElectionCandidate(String eid, String tid)
	{		
		this.tid = tid;
		this.eid = eid;
	}
	//accessor
	public String getEID()
	{
		return (eid);
	}
	public String getTID()
	{
		return (tid);
	}	
	public boolean compareTo(Object obj)
	{
		boolean result;
		ElectionCandidate it;
		
		result = false;
		
		if (obj instanceof ElectionCandidate)
		{
			it = (ElectionCandidate) obj;
			if ( it.getEID().equals(eid)  && it.getTID().equals(tid))
			{
				result = true;
			}
		}
		return result;
	}
	//toString()
	public String toString () 
	{
		return "Election ID " +getEID() + " Task ID "+getTID();
	}
}


